﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for Tela_Inicial.xaml
    /// </summary>
    public partial class Tela_Inicial : Window
    {
        int codRecebido;
        bool validacao;
        public Tela_Inicial()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Tela_Instrucao Open = new Tela_Instrucao();
            Open.Show();
            MessageBox.Show("Cartão invalido", "Erro");
            
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            codRecebido = Cartao.capturaCodigo();
            validacao = Cartao.verificaCodigo(codRecebido);
            if (validacao == true)
            {
                Tela_Instrucao Open = new Tela_Instrucao();
                Open.Show();
            }
            else
            {
                MessageBox.Show("Cartão invalido", "Erro");
            }
        }
    }
}
